package com.lolaage.tracks.test;

import android.app.Application;
import android.content.SharedPreferences;
import android.os.Handler;
import android.preference.PreferenceManager;

import com.lolaage.tracks.MyTrackManager;
import com.lolaage.tracks.content.DB;

/*********************************************************
 * @author : zhaohua
 * @version : 2012-9-17
 * @see : 
 * @Copyright : copyrights reserved by personal 2007-2011
 **********************************************************/
public class TrackApplication extends Application
{
    private static TrackApplication instance;
    public Handler mHandler;
    public SharedPreferences mPreference;
    
    @Override
    public void onCreate()
    {
        super.onCreate();
        instance = this;
        mHandler = new Handler();
        mPreference = PreferenceManager.getDefaultSharedPreferences(this);        
        MyTrackManager.init(this, 1);
    }
    
    @Override
    public void onTerminate()
    {
        MyTrackManager.getInstance().destory();
        super.onTerminate();
    }
    
    public static TrackApplication getInstance()
    {
        return instance;
    }
}
